package com.jy.api.payRes;

import com.jy.api.domain.CouponType;
import com.jy.api.domain.Payment;
import com.jy.api.domain.PaymentStatus;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import javax.persistence.*;
import java.util.Date;

@Table(name = "payment_201912")
@Slf4j
@Entity
@Data
@NoArgsConstructor
public class Payment201912 {

    @Id
    @Column(length = 50)
    private String id;
    private String orderId;
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
    private String storeId;
    private Double amount;
    private boolean success = false;
    private String channel;
    @Enumerated(EnumType.STRING)
    private PaymentStatus status;

    //当支付方式实物优惠券时，以下属性不为空
    /**
     * 优惠券名称
     */
    private String couponName;
    /**
     * 抵用商品id
     */
    private String productId;
    /**
     * 抵用商品名称
     */
    private String productName;
    /**
     * 优惠券实例编码
     */
    private String couponInstanceCode;
    /**
     * 抵用商品销售价格
     */
    private Integer productSalePrice;
    /**
     * 抵用商品数量
     */
    private Short productQuantity;

    private boolean enabled = true;

    /**
     * 优惠券类型
     */
    @Enumerated(EnumType.STRING)
    private CouponType type;

    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date addTime;
    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

}
